<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flexChild</title>
    <style>
        section{
            display: flex;
            width: 60%;
            margin: 0 auto;
            background-color: chartreuse;
            justify-content: space-between;
        }
        div:nth-child(1){
            background-color: blueviolet;
            width: 60px;
            height: 60px;
        }
        div:nth-child(2){
            background-color: coral;
            flex: 1;
        }
        div:nth-child(3){
            background-color: burlywood;
            width: 60px;
            height: 60px;
        }
        p{
            display: flex;
            width: 60%;
            height: 300px;
            margin: 100px auto;
            background-color: chartreuse;
            justify-content: start;
        }
        span{
            width: 60px;
            height: 60px;
            margin: 10px;
        }
        span:nth-child(1){
            background-color: blueviolet;
        }
        span:nth-child(2){
            /* 2号块用align-self对侧轴对齐 */
            background-color: coral;
            align-self: flex-end;
        }
        span:nth-child(3){
            background-color: burlywood;
            /* 3号块主轴用margin */
            margin-right: 10;
            margin-left: auto;
        }
    </style>
</head>
<body>
    <section>
        <div></div>
        <div></div>
        <div></div>
    </section>
    <p>
        <span>1</span>
        <span>2</span>
        <span>3</span>
    </p>
</body>
</html>